Skip to content

List of fields fixes#1994

Merged
fluidnumericsJoe merged 8 commits intov4-devfrom
list-of-fields-fixes
Apr 30, 2025
Merged

List of fields fixes#1994
fluidnumericsJoe merged 8 commits intov4-devfrom
list-of-fields-fixes

Conversation

@fluidnumericsJoe
Copy link
Copy Markdown
Contributor

  • [ X ] Chose the correct base branch (main for v3 changes, v4-dev for v4 changes)

This PR cleans up init for list of fields and fix v4 test errors. It brings in changes to add_field and add_vector_field to avoid using the setattr method. Instead, we opt to extend the dictionary for the fields (which map {field.name : field}). The add_vector_field method optionally adds the VectorField object (if it's not already present) and each of its components by calling add_field.

tests/v4 is now updated to use the new list of fields.

@VeckoTheGecko - there are still a few TODO: Nick items listed in here to keep things safe and tidy.

This commit also brings in changes to add_field and add_vector_field to
avoid using the setattr method. Instead, we opt to extend the dictionary
for the fields (which map {field.name : field}). The add_vector_field
method optionally adds the VectorField object (if it's not already
present) and each of its components by calling add_field
Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fluidnumerics-joe feel free to re-request a review once the changes we discussed are pushed :)

We're most interested in having users be explicit about passing vector
components if they plan on using kernels that require each explicitly
The particleset init and execute functions need a fairly major overhaul
to accomodate changes in the field/fieldset. I think this work would be
better pushed to another PR
@fluidnumericsJoe
Copy link
Copy Markdown
Contributor Author

@VeckoTheGecko - I've opted to skip the tests involving ParticleSet. There's quite a few changes that need to come in for ParticleSet.__init__ and ParticleSet.execute related to dimrange, time_interval, and how ei is initialized to get this to work. It's a fair amount of work that deserves it's own PR at this point.

@fluidnumericsJoe
Copy link
Copy Markdown
Contributor Author

@VeckoTheGecko - Ready to review again

Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change, but once that's fixed LGTM!

Comment thread parcels/fieldset.py
@github-project-automation github-project-automation bot moved this from Backlog to Ready in Parcels development Apr 30, 2025
@fluidnumericsJoe fluidnumericsJoe merged commit 7be4f8e into v4-dev Apr 30, 2025
1 of 8 checks passed
@fluidnumericsJoe fluidnumericsJoe deleted the list-of-fields-fixes branch April 30, 2025 13:47
@github-project-automation github-project-automation bot moved this from Ready to Done in Parcels development Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants